ViewPage<T>
Assembly: ServiceStack.Mvc.dll
View Source
Declaration
public abstract class ViewPage<T> : RazorPage<T>
Properties
Request
View Source
Declaration
public IHttpRequest Request { get; }
Response
View Source
Declaration
public IHttpResponse Response { get; }
IsError
View Source
Declaration
public bool IsError { get; }
ModelError
View Source
Declaration
public object ModelError { get; set; }
IsPostBack
View Source
Declaration
public bool IsPostBack { get; }
PathBase
View Source
Declaration
public string PathBase { get; }
VirtualFiles
View Source
Declaration
public IVirtualFiles VirtualFiles { get; }
VirtualFileSources
View Source
Declaration
public IVirtualPathProvider VirtualFileSources { get; }
AppHost
View Source
Declaration
public IAppHost AppHost { get; }
DebugMode
View Source
Declaration
public bool DebugMode { get; }
ServiceStackProvider
View Source
Declaration
public virtual IServiceStackProvider ServiceStackProvider { get; }
AppSettings
View Source
Declaration
public virtual IAppSettings AppSettings { get; }
ServiceStackRequest
View Source
Declaration
public virtual IHttpRequest ServiceStackRequest { get; }
ServiceStackResponse
View Source
Declaration
public virtual IHttpResponse ServiceStackResponse { get; }
Cache
View Source
Declaration
public virtual ICacheClient Cache { get; }
CacheAsync
View Source
Declaration
public virtual ICacheClientAsync CacheAsync { get; }
Db
View Source
Declaration
public virtual IDbConnection Db { get; }
Redis
View Source
Declaration
public virtual IRedisClient Redis { get; }
MessageProducer
View Source
Declaration
public virtual IMessageProducer MessageProducer { get; }
AuthRepository
View Source
Declaration
public virtual IAuthRepository AuthRepository { get; }
AuthRepositoryAsync
View Source
Declaration
public virtual IAuthRepositoryAsync AuthRepositoryAsync { get; }
SessionFactory
View Source
Declaration
public virtual ISessionFactory SessionFactory { get; }
SessionBag
View Source
Declaration
public virtual ISession SessionBag { get; }
SessionBagAsync
View Source
Declaration
public virtual ISessionAsync SessionBagAsync { get; }
IsAuthenticated
View Source
Declaration
public virtual bool IsAuthenticated { get; }
UserSession
View Source
Declaration
public virtual IAuthSession UserSession { get; }
Gateway
View Source
Declaration
public virtual IServiceGateway Gateway { get; }
Methods
GetLayout(String)
View Source
Declaration
public string GetLayout(string defaultLayout)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | defaultLayout |
GetErrorStatus()
View Source
Declaration
public ResponseStatus GetErrorStatus()
Returns
GetErrorMessage()
View Source
Declaration
public HtmlString GetErrorMessage()
Returns
HtmlString
GetAbsoluteUrl(String)
View Source
Declaration
public HtmlString GetAbsoluteUrl(string virtualPath)
Returns
HtmlString
Parameters
Type | Name |
---|---|
System.String | virtualPath |
ApplyRequestFilters(Object)
View Source
Declaration
public void ApplyRequestFilters(object requestDto)
Parameters
Type | Name |
---|---|
System.Object | requestDto |
GetErrorHtml()
View Source
Declaration
public HtmlString GetErrorHtml()
Returns
HtmlString
GetPlugin<TPlugin>()
View Source
Declaration
public virtual TPlugin GetPlugin<TPlugin>()
where TPlugin : class, IPlugin
Returns
<TPlugin>
Type Parameters
TPlugin
GetRedisAsync()
View Source
Declaration
public virtual ValueTask<IRedisClientAsync> GetRedisAsync()
Returns
ValueTask<ServiceStack.Redis.IRedisClientAsync>
GetSession(Boolean)
View Source
Declaration
public virtual IAuthSession GetSession(bool reload = false)
Returns
ServiceStack.Auth.IAuthSession
Parameters
Type | Name |
---|---|
System.Boolean | reload |
GetSessionAsync(Boolean, CancellationToken)
View Source
Declaration
public virtual Task<IAuthSession> GetSessionAsync(bool reload = false, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IAuthSession>
Parameters
Type | Name |
---|---|
System.Boolean | reload |
CancellationToken | token |
SessionAs<TUserSession>()
View Source
Declaration
public virtual TUserSession SessionAs<TUserSession>()
Returns
<TUserSession>
Type Parameters
TUserSession
SessionAsAsync<TUserSession>(CancellationToken)
View Source
Declaration
public virtual Task<TUserSession> SessionAsAsync<TUserSession>(CancellationToken token = null)
Returns
Task<<TUserSession>>
Parameters
Type | Name |
---|---|
CancellationToken | token |
Type Parameters
TUserSession
SaveSession(IAuthSession, Nullable<TimeSpan>)
View Source
Declaration
protected virtual void SaveSession(IAuthSession session, TimeSpan? expiresIn = null)
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Nullable<TimeSpan> | expiresIn |
SaveSessionAsync(IAuthSession, Nullable<TimeSpan>, CancellationToken)
View Source
Declaration
public virtual Task SaveSessionAsync(IAuthSession session, TimeSpan? expiresIn = null, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Nullable<TimeSpan> | expiresIn |
CancellationToken | token |
ClearSession()
View Source
Declaration
public virtual void ClearSession()
ClearSessionAsync(CancellationToken)
View Source
Declaration
public virtual Task ClearSessionAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
CancellationToken | token |
TryResolve<TDependency>()
View Source
Declaration
public virtual TDependency TryResolve<TDependency>()
Returns
<TDependency>
Type Parameters
TDependency
ResolveService<TService>()
View Source
Declaration
public virtual TService ResolveService<TService>()
Returns
<TService>
Type Parameters
TService
ForwardRequestToServiceStack(IRequest)
View Source
Declaration
public virtual object ForwardRequestToServiceStack(IRequest request = null)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | request |
Dispose()
View Source
Declaration
public void Dispose()
EndServiceStackRequest()
View Source
Declaration
public virtual void EndServiceStackRequest()
RenderErrorIfAny()
View Source
Declaration
public bool RenderErrorIfAny()
Returns
System.Boolean
RedirectIfNotAuthenticated(String)
View Source
Declaration
public void RedirectIfNotAuthenticated(string redirect = null)
Parameters
Type | Name |
---|---|
System.String | redirect |
RedirectToAsync(String)
View Source
Declaration
public Task RedirectToAsync(string path)
Returns
Task
Parameters
Type | Name |
---|---|
System.String | path |
RedirectTo(String)
View Source
Declaration
public HtmlString RedirectTo(string path)
Returns
HtmlString
Parameters
Type | Name |
---|---|
System.String | path |
AssertRole(String, String, String)
View Source
Declaration
public HtmlString AssertRole(string role, string message = null, string redirect = null)
Returns
HtmlString
Parameters
Type | Name |
---|---|
System.String | role |
System.String | message |
System.String | redirect |
AssertRoleAsync(String, String, String)
View Source
Declaration
public Task AssertRoleAsync(string role, string message = null, string redirect = null)
Returns
Task
Parameters
Type | Name |
---|---|
System.String | role |
System.String | message |
System.String | redirect |
AssertPermission(String, String, String)
View Source
Declaration
public HtmlString AssertPermission(string permission, string message = null, string redirect = null)
Returns
HtmlString
Parameters
Type | Name |
---|---|
System.String | permission |
System.String | message |
System.String | redirect |
AssertPermissionAsync(String, String, String)
View Source
Declaration
public Task AssertPermissionAsync(string permission, string message = null, string redirect = null)
Returns
Task
Parameters
Type | Name |
---|---|
System.String | permission |
System.String | message |
System.String | redirect |
Implements
IDisposable